import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {UsersComponent} from './users.component';
import {NgxUserProfileComponent} from './profile/user-profile.component';
import {UserListComponent} from './user-list/user-list.component'

const routes: Routes = [{
  path: '',
  component: UsersComponent,
  children: [{
    path: 'user-profile',
    component: NgxUserProfileComponent,
  },
    {
      path: 'user-list',
      component: UserListComponent,
    },
    {
      path: '',
      redirectTo: 'user-list',
      pathMatch: 'full',
    },
  ],
}];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class UsersRoutingModule {
}
